package com.map.hashmap;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class KeyFromValluExample {
public static void main(String[] args) {
	Map<String,String> map=new HashMap<String,String>();
	map.put("cluster", "Cluster1");
	map.put("server", "J2EE1");
	map.put("domain", "domain1");
	map.put("perf", "PRF1");
	
	Set<String> key=map.keySet();
	for(String str:key){
		System.out.println(str);
	}
	System.out.println("--------");
	Iterator<String> keyitr=map.keySet().iterator();
	while(keyitr.hasNext()){
		System.out.println("key : "+keyitr.next()+" value : "+map.get(keyitr.next()));
	}
	System.out.println("Size of map : "+map.size());



}
}
